<template>
    <view :style="value"></view>
</template>

<script lang="ts" setup>
import { computed, ref } from 'vue'

const props = withDefaults(
    defineProps<{
        height?: string | number
        color?: string
    }>(),
    {
        height: 0,
        color: ''
    }
)
const $u = ref(uni.$u)

const value = computed(() => {
    return {
        height: $u.value.addUnit(props.height),
        backgroundColor: props.color || 'inherit'
    }
})
</script>
